/*
 * test_dns.cpp
 *
 *  Created on: Dec 25, 2013
 *      Author: killerg
 */


#include "share/dns.h"

#include <unistd.h>

bool test_dns() {
    dns_t dns;
    if (!dns.init()) {
        perror("init");
        return false;
    }

    dns.query_ip("killgxlin.vicp.cc", [](const std::string &host, const std::string &ip){
        printf("%s %s\n", host.c_str(), ip.c_str());
    });

    while (true) {
        dns.update();
    }

    dns.destroy();

    return true;
}
